<?php


namespace App\Models\MainDB;
use \Illuminate\Database\Eloquent\Model;

class ScoreMallExchange extends Model
{
    protected $table = 'ln_score_mall_exchange';     //数据库内完整表名

    protected $primaryKey = 'id';    //主键名

    protected $fillable = [
        'id',                 // 主键id
        'user_id',
        'group_id',            //商品组id
        'detail_id',            //商品id
        'reward_id',            //奖励id
        'cost_score',
        'add_time',
    ];
    public $timestamps = false;
    public  function  user_data(){
        return $this->hasOne('App\Models\MainDB\UserData','user_id','user_id');
    }

    public  function  reward_data(){
        return $this->hasOne('App\Models\MainDB\Reward','id','reward_id');
    }
}
